﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_DMDTTHCPList : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdRefresh")]
        private ToolStripButton _CmdRefresh;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtMa")]
        private TextBox _TxtMa;
        [AccessedThroughProperty("TxtTenViet")]
        private TextBox _TxtTenViet;
        [AccessedThroughProperty("VSDichVu")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSDichVu;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private DataView objData;
        public object objFrmCall;
        private clsDMDoiTuongTapHopChiPhi objCP;
        public string strConditions;
        private ToolStripButton _CmdAdd;
        private ToolStripButton _CmdEdit;      
       
        ComponentResourceManager manager;

        public Frm_DMDTTHCPList()
        {
            base.FormClosing += new FormClosingEventHandler(this.Frm_XuatBanList_FormClosing);
            base.KeyDown += new KeyEventHandler(this.Frm_XuatBanList_KeyDown);
            base.Load += new EventHandler(this.Frm_PhieuThuList_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mAllowView = false;
            this.mAllowDel = false;
            this.mAllowEdit = false;
            this.objCP = new clsDMDoiTuongTapHopChiPhi();
            this.strConditions = "";
            this.InitializeComponent();
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_00TestParentChild.cFrmTask = "I";
            MyProject.Forms.Frm_00TestParentChild.ShowDialog();
            this.LoadData();
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0)) && (LVYModule.ConfirmDelete("") && this.objCP.DeleteData(Conversions.ToString(this.VSlist[this.VSlist.Row, 0]))))
            {
                this.VSlist.RemoveItem(this.VSlist.Row);
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                ReportModule.PrintHoaDonDichVu(Conversions.ToString(this.VSlist[this.VSlist.Row, 0]));
            }
        }

        private void CmdRefresh_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_PhieuThuList_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                SetEvents();
                this.CmdAdd.Enabled = this.mAllowAdd;
                this.CmdEdit.Enabled = this.mAllowEdit;
                this.CmdDel.Enabled = this.mAllowDel;
                this.Cursor = Cursors.WaitCursor;
                //BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, true, "", "");               
                this.LoadData();                
                this.Cursor = Cursors.Default;
            }
        }

        private void SetEvents()
        {
            this._CmdAdd.Click += this.CmdAdd_Click;

            this._CmdDel.Click += this.CmdDel_Click;
            this._TxtMa.LostFocus += this.TxtMa_LostFocus;
            this._TxtTenViet.LostFocus += this.TxtTenViet_LostFocus;

            this._CmdPrint.Click += this.CmdPrint_Click;

            this._CmdRefresh.Click += this.CmdRefresh_Click;           

            this._VSlist.DoubleClick += this.VSlist_DoubleClick;
            this._VSlist.SelChange += this.VSlist_SelChange;
        }

        private void Frm_XuatBanList_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.strConditions = "";
        }

        private void Frm_XuatBanList_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                this.Dispose();
            }
            else if (keyCode == Keys.F5)
            {
                this.CmdRefresh_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

     //   [DebuggerStepThrough]
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Frm_DMDTTHCPList));
            this._VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this._ToolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
            this._ToolStripButton1 = new System.Windows.Forms.ToolStripSeparator();
            this._ToolStrip1 = new System.Windows.Forms.ToolStrip();
            this._CmdAdd = new System.Windows.Forms.ToolStripButton();
            this._CmdEdit = new System.Windows.Forms.ToolStripButton();
            this._ToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this._CmdPrint = new System.Windows.Forms.ToolStripButton();
            this._CmdDel = new System.Windows.Forms.ToolStripButton();
            this._CmdExit = new System.Windows.Forms.ToolStripButton();
            this._CmdHelp = new System.Windows.Forms.ToolStripButton();
            this._CmdRefresh = new System.Windows.Forms.ToolStripButton();
            this._ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this._Panel1 = new System.Windows.Forms.Panel();
            this._TxtMa = new System.Windows.Forms.TextBox();
            this._TxtTenViet = new System.Windows.Forms.TextBox();
            this._Label2 = new System.Windows.Forms.Label();
            this._Label1 = new System.Windows.Forms.Label();
            this._Panel2 = new System.Windows.Forms.Panel();
            this._Panel3 = new System.Windows.Forms.Panel();
            this._VSDichVu = new C1.Win.C1FlexGrid.C1FlexGrid();
            ((System.ComponentModel.ISupportInitialize)(this._VSlist)).BeginInit();
            this._ToolStrip1.SuspendLayout();
            this._Panel1.SuspendLayout();
            this._Panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._VSDichVu)).BeginInit();
            this.SuspendLayout();
            // 
            // _VSlist
            // 
            this._VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this._VSlist.ColumnInfo = resources.GetString("_VSlist.ColumnInfo");
            this._VSlist.Dock = System.Windows.Forms.DockStyle.Fill;
            this._VSlist.ExtendLastCol = true;
            this._VSlist.FocusRect = C1.Win.C1FlexGrid.FocusRectEnum.None;
            this._VSlist.KeyActionEnter = C1.Win.C1FlexGrid.KeyActionEnum.MoveAcross;
            this._VSlist.Location = new System.Drawing.Point(0, 80);
            this._VSlist.Name = "_VSlist";
            this._VSlist.Rows.Count = 13;
            this._VSlist.Rows.DefaultSize = 17;
            this._VSlist.Rows.MaxSize = 18;
            this._VSlist.Rows.MinSize = 18;
            this._VSlist.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.Row;
            this._VSlist.Size = new System.Drawing.Size(894, 324);
            this._VSlist.StyleInfo = resources.GetString("_VSlist.StyleInfo");
            this._VSlist.TabIndex = 2;
            this._VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            // 
            // _ToolStripSeparator3
            // 
            this._ToolStripSeparator3.Name = "_ToolStripSeparator3";
            this._ToolStripSeparator3.Size = new System.Drawing.Size(6, 25);
            // 
            // _ToolStripButton1
            // 
            this._ToolStripButton1.Name = "_ToolStripButton1";
            this._ToolStripButton1.Size = new System.Drawing.Size(6, 25);
            // 
            // _ToolStrip1
            // 
            this._ToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._CmdAdd,
            this._CmdEdit,
            this._ToolStripSeparator2,
            this._CmdPrint,
            this._ToolStripButton1,
            this._CmdDel,
            this._ToolStripSeparator3,
            this._CmdExit,
            this._CmdHelp,
            this._CmdRefresh,
            this._ToolStripSeparator1});
            this._ToolStrip1.Location = new System.Drawing.Point(0, 0);
            this._ToolStrip1.Name = "_ToolStrip1";
            this._ToolStrip1.Size = new System.Drawing.Size(894, 25);
            this._ToolStrip1.TabIndex = 0;
            this._ToolStrip1.Text = "ToolStrip1";
            // 
            // _CmdAdd
            // 
            this._CmdAdd.Image = ((System.Drawing.Image)(resources.GetObject("_CmdAdd.Image")));
            this._CmdAdd.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdAdd.Name = "_CmdAdd";
            this._CmdAdd.Size = new System.Drawing.Size(82, 22);
            this._CmdAdd.Text = "&Thêm mới";
            // 
            // _CmdEdit
            // 
            this._CmdEdit.Image = ((System.Drawing.Image)(resources.GetObject("_CmdEdit.Image")));
            this._CmdEdit.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdEdit.Name = "_CmdEdit";
            this._CmdEdit.Size = new System.Drawing.Size(46, 22);
            this._CmdEdit.Text = "&Sửa";
            this._CmdEdit.Visible = false;
            // 
            // _ToolStripSeparator2
            // 
            this._ToolStripSeparator2.Name = "_ToolStripSeparator2";
            this._ToolStripSeparator2.Size = new System.Drawing.Size(6, 25);
            // 
            // _CmdPrint
            // 
            this._CmdPrint.Image = ((System.Drawing.Image)(resources.GetObject("_CmdPrint.Image")));
            this._CmdPrint.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdPrint.Name = "_CmdPrint";
            this._CmdPrint.Size = new System.Drawing.Size(37, 22);
            this._CmdPrint.Text = "&In";
            // 
            // _CmdDel
            // 
            this._CmdDel.Image = ((System.Drawing.Image)(resources.GetObject("_CmdDel.Image")));
            this._CmdDel.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdDel.Name = "_CmdDel";
            this._CmdDel.Size = new System.Drawing.Size(47, 22);
            this._CmdDel.Text = "&Xóa";
            // 
            // _CmdExit
            // 
            this._CmdExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this._CmdExit.Image = ((System.Drawing.Image)(resources.GetObject("_CmdExit.Image")));
            this._CmdExit.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdExit.Name = "_CmdExit";
            this._CmdExit.Size = new System.Drawing.Size(58, 22);
            this._CmdExit.Text = "Th&oát";
            this._CmdExit.Visible = false;
            // 
            // _CmdHelp
            // 
            this._CmdHelp.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this._CmdHelp.Image = ((System.Drawing.Image)(resources.GetObject("_CmdHelp.Image")));
            this._CmdHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
            this._CmdHelp.Name = "_CmdHelp";
            this._CmdHelp.Size = new System.Drawing.Size(52, 22);
            this._CmdHelp.Text = "&Help";
            // 
            // _CmdRefresh
            // 
            this._CmdRefresh.Image = ((System.Drawing.Image)(resources.GetObject("_CmdRefresh.Image")));
            this._CmdRefresh.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdRefresh.Name = "_CmdRefresh";
            this._CmdRefresh.Size = new System.Drawing.Size(66, 22);
            this._CmdRefresh.Text = "Refresh";
            // 
            // _ToolStripSeparator1
            // 
            this._ToolStripSeparator1.Name = "_ToolStripSeparator1";
            this._ToolStripSeparator1.Size = new System.Drawing.Size(6, 25);
            // 
            // _Panel1
            // 
            this._Panel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("_Panel1.BackgroundImage")));
            this._Panel1.Controls.Add(this._TxtMa);
            this._Panel1.Controls.Add(this._TxtTenViet);
            this._Panel1.Controls.Add(this._Label2);
            this._Panel1.Controls.Add(this._Label1);
            this._Panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this._Panel1.Location = new System.Drawing.Point(0, 25);
            this._Panel1.Name = "_Panel1";
            this._Panel1.Size = new System.Drawing.Size(894, 55);
            this._Panel1.TabIndex = 1;
            // 
            // _TxtMa
            // 
            this._TxtMa.Location = new System.Drawing.Point(40, 20);
            this._TxtMa.Name = "_TxtMa";
            this._TxtMa.Size = new System.Drawing.Size(191, 20);
            this._TxtMa.TabIndex = 3;
           // this._TxtMa.TextChanged += new System.EventHandler(this.TxtMa_TextChanged);
            // 
            // _TxtTenViet
            // 
            this._TxtTenViet.Location = new System.Drawing.Point(307, 20);
            this._TxtTenViet.Name = "_TxtTenViet";
            this._TxtTenViet.Size = new System.Drawing.Size(263, 20);
            this._TxtTenViet.TabIndex = 2;
            // 
            // _Label2
            // 
            this._Label2.AutoSize = true;
            this._Label2.Location = new System.Drawing.Point(275, 23);
            this._Label2.Name = "_Label2";
            this._Label2.Size = new System.Drawing.Size(26, 13);
            this._Label2.TabIndex = 1;
            this._Label2.Text = "Tên";
            // 
            // _Label1
            // 
            this._Label1.AutoSize = true;
            this._Label1.Location = new System.Drawing.Point(12, 22);
            this._Label1.Name = "_Label1";
            this._Label1.Size = new System.Drawing.Size(22, 13);
            this._Label1.TabIndex = 0;
            this._Label1.Text = "Mã";
            // 
            // _Panel2
            // 
            this._Panel2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("_Panel2.BackgroundImage")));
            this._Panel2.Controls.Add(this._Panel3);
            this._Panel2.Controls.Add(this._VSDichVu);
            this._Panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this._Panel2.Location = new System.Drawing.Point(0, 404);
            this._Panel2.Name = "_Panel2";
            this._Panel2.Size = new System.Drawing.Size(894, 165);
            this._Panel2.TabIndex = 120;
            // 
            // _Panel3
            // 
            this._Panel3.BackColor = System.Drawing.Color.Transparent;
            this._Panel3.Dock = System.Windows.Forms.DockStyle.Right;
            this._Panel3.Location = new System.Drawing.Point(568, 0);
            this._Panel3.Name = "_Panel3";
            this._Panel3.Size = new System.Drawing.Size(326, 29);
            this._Panel3.TabIndex = 2;
            // 
            // _VSDichVu
            // 
            this._VSDichVu.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this._VSDichVu.ColumnInfo = resources.GetString("_VSDichVu.ColumnInfo");
            this._VSDichVu.Dock = System.Windows.Forms.DockStyle.Bottom;
            this._VSDichVu.ExtendLastCol = true;
            this._VSDichVu.KeyActionEnter = C1.Win.C1FlexGrid.KeyActionEnum.MoveAcross;
            this._VSDichVu.Location = new System.Drawing.Point(0, 29);
            this._VSDichVu.Margin = new System.Windows.Forms.Padding(0);
            this._VSDichVu.Name = "_VSDichVu";
            this._VSDichVu.Rows.Count = 13;
            this._VSDichVu.Rows.DefaultSize = 17;
            this._VSDichVu.Rows.MaxSize = 18;
            this._VSDichVu.Rows.MinSize = 18;
            this._VSDichVu.Size = new System.Drawing.Size(894, 136);
            this._VSDichVu.StyleInfo = resources.GetString("_VSDichVu.StyleInfo");
            this._VSDichVu.TabIndex = 3;
            this._VSDichVu.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            // 
            // Frm_DMDTTHCPList
            // 
            this.ClientSize = new System.Drawing.Size(894, 569);
            this.Controls.Add(this._VSlist);
            this.Controls.Add(this._Panel1);
            this.Controls.Add(this._Panel2);
            this.Controls.Add(this._ToolStrip1);
            this.MinimizeBox = false;
            this.Name = "Frm_DMDTTHCPList";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Tag = "BH-0015";
            this.Text = "DANH SACH DOI TUONG TAP HOP CHI PHI";
            ((System.ComponentModel.ISupportInitialize)(this._VSlist)).EndInit();
            this._ToolStrip1.ResumeLayout(false);
            this._ToolStrip1.PerformLayout();
            this._Panel1.ResumeLayout(false);
            this._Panel1.PerformLayout();
            this._Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this._VSDichVu)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        public void LoadData()
        {
            string strCondition="";
            this.Cursor = Cursors.WaitCursor;
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtMa.Text), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                strCondition = "Ma ='" +this.TxtMa.Text.Trim()+"'";
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTenViet.Text), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {                
                strCondition = strCondition+"TenViet Like'%" + this.TxtTenViet.Text.Trim() + "%'";
            }  
            
            this.objData = new DataView(this.objCP.GetList(strCondition));
            if (this.objData != null)
            {
                this.VSlist.DataSource = this.objData;
                this.VSlist.Cols[0].Visible = false;
                this.VSlist.Cols[1].Visible = false;
                this.VSlist.Cols[4].Visible = false;
                this.VSlist.Cols[5].Visible = false;
                this.VSlist.Cols[7].Visible = false;
                this.VSlist.Cols[8].Visible = false;
                this.VSlist.Cols[2].Width = 150;
                this.VSlist.Cols[3].Width = 300;
                this.VSlist[0, 2] = modGeneral.Tranlated("Mã", "");
                this.VSlist[0, 3] = modGeneral.Tranlated("Tên", "");
                this.VSlist[0, 6] = modGeneral.Tranlated("Diễn giải", "");               
                if (this.VSlist.Rows.Count > 1)
                {
                    this.VSlist.Select(1, 1);
                }
                this.VSlist.Focus();
                this.VSlist.Styles.Alternate.BackColor = ProfessionalColors.ToolStripGradientMiddle;
                this.Cursor = Cursors.Default;
            }
        }

        public void LoadDetailsDichVu(string strKhoa)
        {
            DataTable detailDichVu = this.objCP.GetDetailDichVu(strKhoa);
            int num = 0;
            C1.Win.C1FlexGrid.C1FlexGrid vSDichVu = this.VSDichVu;
            vSDichVu.Rows.Count = 1;
            int num2 = detailDichVu.Rows.Count - 1;
            for (num = 0; num <= num2; num++)
            {
                vSDichVu.AddItem("");
                vSDichVu[vSDichVu.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["Khoa"]);
                vSDichVu[vSDichVu.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["KhoaDoiTuongTapHopChiPhi"]);
                vSDichVu[vSDichVu.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["KhoaHangHoa"]);
                vSDichVu[vSDichVu.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TenHangHoa"]);
                vSDichVu[vSDichVu.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["DienGiai"]);                
            }
            vSDichVu = null;
        }

        public void SetLanguage()
        {
             IEnumerator enumerator=null;
             IEnumerator enumerator2=null;
            try
            {
                enumerator = this.Panel1.Controls.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    object objectValue = RuntimeHelpers.GetObjectValue(enumerator.Current);
                    if (Strings.Left(Conversions.ToString(NewLateBinding.LateGet(objectValue, null, "Name", new object[0], null, null, null)), 3).ToUpper() == "CMD")
                    {
                        NewLateBinding.LateSet(objectValue, null, "Text", new object[] { modGeneral.Tranlated(Conversions.ToString(NewLateBinding.LateGet(objectValue, null, "text", new object[0], null, null, null)), "") }, null, null);
                    }
                    if (Strings.Left(Conversions.ToString(NewLateBinding.LateGet(objectValue, null, "Name", new object[0], null, null, null)), 3).ToUpper() == "LAB")
                    {
                        NewLateBinding.LateSet(objectValue, null, "Text", new object[] { modGeneral.Tranlated(Conversions.ToString(NewLateBinding.LateGet(objectValue, null, "text", new object[0], null, null, null)), "") }, null, null);
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            try
            {
                enumerator2 = this.ToolStrip1.Items.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    object instance = RuntimeHelpers.GetObjectValue(enumerator2.Current);
                    if (Strings.Left(Conversions.ToString(NewLateBinding.LateGet(instance, null, "Name", new object[0], null, null, null)), 3).ToUpper() == "CMD")
                    {
                        NewLateBinding.LateSet(instance, null, "Text", new object[] { modGeneral.Tranlated(Conversions.ToString(NewLateBinding.LateGet(instance, null, "text", new object[0], null, null, null)), "") }, null, null);
                    }
                    if (Strings.Left(Conversions.ToString(NewLateBinding.LateGet(instance, null, "Name", new object[0], null, null, null)), 3).ToUpper() == "LAB")
                    {
                        NewLateBinding.LateSet(instance, null, "Text", new object[] { modGeneral.Tranlated(Conversions.ToString(NewLateBinding.LateGet(instance, null, "text", new object[0], null, null, null)), "") }, null, null);
                    }
                }
            }
            finally
            {
                if (enumerator2 is IDisposable)
                {
                    (enumerator2 as IDisposable).Dispose();
                }
            }
            this.Text = modGeneral.Tranlated(this.Text, "");
            LVYModule.SetTitleGrid(this.VSlist);
        }

        public void setUserRight()
        {
            this.CmdAdd.Enabled = this.mAllowEdit;
            this.CmdEdit.Enabled = this.mAllowEdit;
            this.CmdDel.Enabled = this.mAllowDel;
        }

        private void VSlist_DoubleClick(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                this.strConditions = "";
                if (this.objFrmCall == null)
                {
                    MyProject.Forms.Frm_00TestParentChild.Dispose();
                    MyProject.Forms.Frm_00TestParentChild.cFrmKhoa = Conversions.ToString(this.VSlist[this.VSlist.Row, 0]);
                    MyProject.Forms.Frm_00TestParentChild.ShowDialog();
                    this.LoadData();
                }
                else
                {
                    object[] objArray = new object[1];
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    int row = this.VSlist.Row;
                    int num2 = 0;
                    objArray[0] = RuntimeHelpers.GetObjectValue(vSlist[row, num2]);
                    object[] arguments = objArray;
                    bool[] copyBack = new bool[] { true };
                    NewLateBinding.LateCall(this.objFrmCall, null, "InsertHoaDon", arguments, null, null, copyBack, true);
                    if (copyBack[0])
                    {
                        vSlist[row, num2] = RuntimeHelpers.GetObjectValue(arguments[0]);
                    }
                    this.Close();
                }
            }
            
        }

        private void VSlist_SelChange(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                this.LoadDetailsDichVu(Conversions.ToString(this.VSlist[this.VSlist.Row, 0]));
            }            
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdEdit = value;
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdExit = value;
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }


        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdRefresh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdRefresh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdRefresh_Click);
                if (this._CmdRefresh != null)
                {
                    this._CmdRefresh.Click -= handler;
                }
                this._CmdRefresh = value;
                if (this._CmdRefresh != null)
                {
                    this._CmdRefresh.Click += handler;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }


        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }


        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }
       
        internal virtual TextBox TxtMa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtMa_LostFocus);
                if (this._TxtMa != null)
                {
                    this._TxtMa.LostFocus -= handler;
                }
                this._TxtMa = value;
                if (this._TxtMa != null)
                {
                    this._TxtMa.LostFocus += handler;
                }
            }
        }
        internal virtual TextBox TxtTenViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTenViet_LostFocus);
                if (this._TxtTenViet != null)
                {
                    this._TxtTenViet.LostFocus -= handler;
                }
                this._TxtTenViet = value;
                if (this._TxtTenViet != null)
                {
                    this._TxtTenViet.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSDichVu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSDichVu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSDichVu = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSlist_DoubleClick);
                EventHandler handler2 = new EventHandler(this.VSlist_SelChange);
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick -= handler;
                    this._VSlist.SelChange -= handler2;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick += handler;
                    this._VSlist.SelChange += handler2;
                }
            }
        }

        private void TxtMa_LostFocus(object sender, EventArgs e)
        {
            this.LoadData();
        }
        private void TxtTenViet_LostFocus(object sender, EventArgs e)
        {
            this.LoadData();
        }

    }
}

